import request from '@/router/axios';

export const getList = (current, size, params) => {
  return request({
    url: '/api/mes-product/stat-fpy-goal/page',
    method: 'get',
    params: {
      ...params,
      current,
      size
    }
  });
};

export const remove = (ids) => {
  return request({
    url: '/api/mes-product/stat-fpy-goal/remove',
    method: 'post',
    params: {
      ids
    }
  });
};

export const add = (row) => {
  return request({
    url: '/api/mes-product/stat-fpy-goal/submit',
    method: 'post',
    data: row
  });
};

export const getDetail = (id) => {
  return request({
    url: '/api/mes-product/stat-fpy-goal/detail',
    method: 'get',
    params: {
      id
    }
  });
};

//规则配置
export const addRule = (row) => {
  return request({
    url: '/api/mes-product/stat-fpy-rule/submit',
    method: 'post',
    data: row
  });
};

export const getRuleDetail = (params) => {
  return request({
    url: '/api/mes-product/stat-fpy-rule/detail',
    method: 'get',
    params
  });
};


export const getChild = (current, size, params) => {
  return request({
    url: '/api/mes-product/stat-fpy-goal/page',
    method: 'get',
    params: {
      ...params,
      current,
      size
    }
  });
};

export const saveDetail = (row) => {
  return request({
    url: '/api/mes-product/stat-fpy-goal/submit',
    method: 'post',
    data: row
  });
};

export const detailRemove = (ids) => {
  return request({
    url: '/api/mes-product/stat-fpy-goal/remove',
    method: 'post',
    params: {
      ids
    }
  });
};

export const getWorkSectionList = (productPartId) => {
  return request({
    url: '/api/mes-product/part-master-section/detail-by-product-part-id',
    method: 'get',
    params: {
      productPartId
    }
  });
};


